package BookManagement.book;

/*
 *图书类：主要包括图书的名字、作者、价格、图书类型、借出状态
 */


public class Book {
    private String name;
    private String author;
    private int price;
    private String type;
    private boolean status;//借出？未借出？状态表示，默认是false:表示未借出

    //构造函数
    public Book(String name, String author, int price, String type) {
        this.name = name;
        this.author = author;
        this.price = price;
        this.type = type;
    }

    //由于是private，因为需要Get和Set设置和获取
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getAuthor() {
        return author;
    }

    public void setAuthor(String author) {
        this.author = author;
    }

    public int getPrice() {
        return price;
    }

    public void setPrice(int price) {
        this.price = price;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public boolean getStatus() {return status;}

    public void setStatus(boolean status) {
        this.status = status;
    }

    @Override
    public String toString() {
        return "Book{" +
                "name='" + name + '\'' +
                ", author='" + author + '\'' +
                ", price=" + price +
                ", type='" + type + '\'' +
                ", status=" + (status ?"\"已借出\"":"\"未借出\"") +
                '}';
    }
}
